#ifndef ARGUMENTSPARSER_H_INCLUDED
#define ARGUMENTSPARSER_H_INCLUDED

#include <Ape/Object.h>
#include <Ape/String.h>
#include <Ape/Collections/Array.h>
#include <Ape/Collections/Map.h>

namespace Ape {
	namespace CLI {
		using namespace Ape::Collections;
		
		class ArgumentsParser : public Object {
			TYPE_NAME ("Ape::CLI::ArgumentsParser")
		private:
			Array<String> m_Tokens;
			
			String m_Executable;
			Map<String, String> m_Options;
			
			void ProcessToken(const String& token);
			void Process();
		public:
			ArgumentsParser(int argc, char** argv);
			ArgumentsParser(const Array<String>& args);
			virtual ~ArgumentsParser();
			
			const String get_Executable() const;
			
			bool IsSet(const String& optionName);
			String StringValue(const String& optionName, bool mayBeClear = false, const String& defaultsTo = L"");
			
			virtual void _Dump(bool verbose = false) const;
		};
	}
}

#endif // ARGUMENTSPARSER_H_INCLUDED
